package a02;

import util.Pair;

public class MinMaxTicTacToeControl extends TicTacToeControl {
    private static final long serialVersionUID = 1L;

    private GameAI<Pair<Byte, Byte>> ai = new MinMaxGame<Pair<Byte, Byte>>();

    public MinMaxTicTacToeControl() {
	this(new TicTacToe(),0);
    }

    public MinMaxTicTacToeControl(TicTacToe g, int kiLevel) {
	super(g,kiLevel);
	setGameMode1Player(true);
    }

 

    @Override
    public void whenMousePressed(byte c, byte r) {
	if (this.getBoard().getGame().ended()) {
	    return;
	}
	this.getBoard()
		.setGame((TicTacToe) this.ai.doBestMove(this.getBoard().getGame()));
    }
}
